package io.renren.modules.jxgkteacher.dao;


import io.renren.modules.jxgkphone.tempEntity.TeacherAttendanceStateEntity;
import io.renren.modules.jxgkphone.tempEntity.TempUpdateAttend;
import io.renren.modules.jxgkteacher.entity.StudentInfoEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;


import java.util.List;

@Repository
@Mapper
public interface TeacherClassAttendanceMapper {
    @Select("Select class_name from class_course where course_teacher_id=#{course_teacher_id}")
    List<String> classList(String course_teacher_id);
    @Select("Select student_school_id,student_name,student_sexual from student_info where student_class_name=#{student_class_name}")
    List<StudentInfoEntity> studentList(String student_class_name);
    @Select("Select is_attendance_teacher from class_attendence where course_id=#{courseId}")
    List<String> modifyState(String courseId);
    @Insert("Insert into class_attendence(course_id," +
            "attendance_state_teacher," +
            "operator_id, " +
            "operator_name , " +
            "is_attendance_teacher, " +
            "student_id) values(" +
            "#{cid}," +
            "#{attendanceStateTeacher}," +
            "#{operatorId}," +
            "#{operatorName}," +
            "#{isAttendanceTeacher}," +
            "#{stuId})")
    void InsertState(TeacherAttendanceStateEntity teacherAttendanceStateEntity);
    @Delete("Delete from class_attendence where course_id=#{courseId}")
    void deleteClassState(String courseId);

}
